<?php

class Core_Form_Admin_Form_Addelement extends Form
{
	protected function _init()
	{
		$this -> addElement('@select', 'type', array(
				'label' => 'element type',
				'multiOptions' => Agis::getTable('core@form') -> getTypesAsOptions()
		));
		
		$this -> addElement('@select', 'form_id', array(
				'label' => 'form',
				'multiOptions' => Agis::getTable('core@form') -> getFormsAsOptions()
		));
		
		$this -> addElement('@radio', 'enabled', array(
				'label' => 'enabled',
				'required'=>1,
				'value'=>1,
				'multiOptions'=>array(
					0=>'no',
					1=>'yes',
				),
		));
		
		$this -> addElement('@title', 'priority', array(
				'label' => 'priority',
				'required'=>1,
				'value'=>99,
		));
		
		$this -> addElement('@title', 'pid', array(
				'label' => 'parent id',
				'required'=>1,
				'value'=>0,
		));
		
		$this -> addElement('@title', 'name', array(
				'label' => 'name',
				'required'=>1,
				'desc'=>'unix name only'
		));
		
		$this -> addElement('@title', 'label', array(
				'label' => 'label',
				'required'=>1,
				'desc'=>'element label'
		));
		
		$this -> addElement('@title', 'desc', array(
				'label' => 'desc',
				'required'=>1,
				'desc'=>'element description'
		));
		
		$this -> addElement('@title', 'validator', array(
				'label' => 'validator',
				'required'=>1,
				'desc'=>'validator'
		));
				
		$this -> addElement('@group', 'buttons');
		
		$this -> buttons -> addElement('@submit', 'submit') -> addElement('@cancel', 'cancel');
	}

}
